package com.ben.xinyue.seckill.rabbitmq;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: xinyue
 * @date: 2020/9/15 14:57
 * @description: 消息配置
 * @modifiedBy:
 * @version: 1.0
 */
@Configuration
public class MQConfig {

    public static final String MIAOSHA_QUEUE = "miaosha.queue";
    public static final String QUEUE = "queue";
    public static final String TOPIC_EXCHANGE = "topicExchage";

    @Bean
    public Queue miaoshaQueue() {
        return new Queue("miaosha.queue", true);
    }

    /**
     * Direct模式 交换机Exchange
     * */
    @Bean
    public Queue queue() {
        return new Queue(QUEUE, true);
    }
}
